package com.plugin.manage.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.plugin.manage.pojo.dto.ElderBookingInfoDTO;
import com.plugin.manage.common.PageResult;
import com.plugin.manage.mapper.ElderBookingMapper;
import com.plugin.manage.service.IElderBookingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 老人预订床位信息服务实现类
 * 
 * @author mark
 * @date 2025-08-01
 */
@Service
public class ElderBookingServiceImpl implements IElderBookingService {

    @Autowired
    private ElderBookingMapper elderBookingMapper;

    @Override
    public PageResult<ElderBookingInfoDTO> getElderBookingInfo(Long current, Long size) {
        // 创建MyBatis-Plus分页对象
        Page<ElderBookingInfoDTO> page = new Page<>(current, size);
        Page<ElderBookingInfoDTO> resultPage = (Page<ElderBookingInfoDTO>) elderBookingMapper.getElderBookingInfo(page);
        return PageResult.of(resultPage);
    }


}
